package com.eric.rabbitmq.hello;

import com.eric.rabbitmq.config.RabbitSimpleConfig;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author chenw-i
 * @version 1.0.0
 * @ClassName HelloSender.java
 * @Description TODO
 * @createTime 2020年07月29日 15:58:00
 */
@Component
public class HelloSender2 {

    @Autowired
    private AmqpTemplate rabbitTemplate;

    public void send(Object obj) {
        String context = "hello " + obj;
        System.out.println("Sender2 : " + context);
        this.rabbitTemplate.convertAndSend(RabbitSimpleConfig.QUEUE_HELLO, context);
    }
}
